﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IMModel.Domain;

namespace DataAccessLayer.Classes
{
    public static class IMModelExtensions
    {
        public static bool Containts(this DepartmentTerm Dep, Respondent R)
        {
            bool flag = false;

            if (R.Department.IDDepartment == Dep.IDDepartment)
            {
                return true;
            }
            else
            {
                foreach (DepartmentTerm Child in Dep.DepartmentTerms)
                {
                    flag = flag || Child.Containts(R);
                }
                return flag;
            }
        }
    }
}
